/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package com.bap.ele.workbench.model.Course.impl;

import com.bap.ele.workbench.model.Course.CHAPTER;
import com.bap.ele.workbench.model.Course.COURSEobject;
import com.bap.ele.workbench.model.Course.CoursePackage;

import java.util.Collection;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>CHAPTER</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link com.bap.ele.workbench.model.Course.impl.CHAPTERImpl#getCourseObjects <em>Course Objects</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CHAPTERImpl extends COURSEobjectImpl implements CHAPTER {
	/**
	 * The cached value of the '{@link #getCourseObjects() <em>Course Objects</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCourseObjects()
	 * @generated
	 * @ordered
	 */
	protected EList<COURSEobject> courseObjects;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CHAPTERImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CoursePackage.Literals.CHAPTER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<COURSEobject> getCourseObjects() {
		if (courseObjects == null) {
			courseObjects = new EObjectResolvingEList<COURSEobject>(COURSEobject.class, this, CoursePackage.CHAPTER__COURSE_OBJECTS);
		}
		return courseObjects;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CoursePackage.CHAPTER__COURSE_OBJECTS:
				return getCourseObjects();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CoursePackage.CHAPTER__COURSE_OBJECTS:
				getCourseObjects().clear();
				getCourseObjects().addAll((Collection<? extends COURSEobject>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CoursePackage.CHAPTER__COURSE_OBJECTS:
				getCourseObjects().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CoursePackage.CHAPTER__COURSE_OBJECTS:
				return courseObjects != null && !courseObjects.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //CHAPTERImpl
